package com.iretailer.quartz.common;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class QuartzJobFactory implements Job{

//	private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

	private Logger log = LoggerFactory.getLogger(QuartzJobFactory.class);

	@Override
	public void execute(JobExecutionContext context){
		QuartzJobBean scheduleJob = (QuartzJobBean)context.getMergedJobDataMap().get("scheduleJob");
		try {
			TaskUtils.invokMethod(scheduleJob);
//			log.warn("[" + scheduleJob.getJobName() + "] 执行成功");
		} catch (Exception e) {
		   e.printStackTrace();
		}
	}

}
